<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');?>
<?php if(ROUTE_A=='init') {?>
<form name="myform" action="?m=admin&c=org&a=listorder" method="post">
<div class="pad-lr-10">
<div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
            <th width="80"><?php echo L('listorder');?></th>
            <th width="100">id</th>
            <th><?php echo L('部门');?></th>
			<th><?php echo L('operations_manage');?></th>
            </tr>
        </thead>
	<tbody>
    <?php echo $categorys;?>
	</tbody>
    </table>
  
    <div class="btn"><input type="submit" class="button" name="dosubmit" value="<?php echo L('listorder')?>" /></div>  </div>
</div>
</div>
</form>
</body>
</html>


<?php } elseif(ROUTE_A=='add') {?>
<script type="text/javascript">
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
		$("#name").formValidator({onshow:"请输入部门名称",onfocus:"请输入部门名称",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"请输入部门名称"});
		
	})
//-->
</script>
<div class="common-form">
<form name="myform" id="myform" action="?m=admin&c=org&a=add" method="post">
<table width="100%" class="table_form contentWrap">
      <tr>
        <th width="200">上级部门：</th>
        <td><select name="info[parentid]" >
        <option value="0">宝润</option>
<?php echo $select_categorys;?>
</select></td>
      </tr>
   
      <tr>
        <th><?php echo ('部门名称')?>：</th>
        <td><input type="text" name="info[name]" id="name" class="input-text" ></td>
      </tr>

	<tr>
        <th><?php echo ('备注')?>：</th>
        <td><input type="text" name="info[data]" class="input-text" ></td>
      </tr>
	
	  
</table>
<!--table_form_off-->
</div>
    <div class="bk15"></div>
	<div class="btn"><input type="submit" id="dosubmit" class="button" name="dosubmit" value="<?php echo L('submit')?>"/></div>
</div>

</form>

<?php } elseif(ROUTE_A=='edit') {?>
<script type="text/javascript">
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
		
		$("#name").formValidator({onshow:"请输入部门名称",onfocus:"请输入部门名称",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"请输入部门名称"});
	})
//-->
</script>
<div class="common-form">
<form name="myform" id="myform" action="?m=admin&c=org&a=edit" method="post">
<table width="100%" class="table_form contentWrap">
      <tr>
        <th width="200">上级部门：</th>
        <td><select name="info[parentid]" style="width:200px;">
 <option value="0">宝润</option>
<?php echo $select_categorys;?>
</select></td>
      </tr>
      <tr>
        <th><?php echo ('部门名称')?>：</th>
        <td><input type="text" name="info[name]" id="name" class="input-text" value="<?php echo $name?>"></td>
      </tr>
	<tr>
        <th><?php echo ('备注')?>：</th>
        <td><input type="text" name="info[data]" class="input-text" value="<?php echo $data?>"></td>
      </tr>

</table>
<!--table_form_off-->
</div>
    <div class="bk15"></div>
	<input name="id" type="hidden" value="<?php echo $id?>">
    <div class="btn"><input type="submit" id="dosubmit" class="button" name="dosubmit" value="<?php echo L('submit')?>"/></div>
</div>

</form>
<?php }?>
</body>
</html>